# coding:utf-8
"""
oracle数据库导出insert语句转换为符合mySQL语法的脚本
2013-11-14
"""

from sys import argv

script, filename, newFile = argv

print "Opening the file..."
target = open(filename, 'r')
newFile = open(newFile, 'w')
newFile.truncate()
for line in target.readlines():
  if "insert" in line:
    line = line.lower()
    newFile.write(line)
  elif "values" in line:
    newFile.write(line)
  else:
    newFile.write("-- " + line)
